package com.jxgm.spring.boot.entity;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.Date;
import java.util.Map;

/**
 * @author Administrator
 * @date 2020/9/3 9:45
 * @description
 **/
@Component
@ConfigurationProperties(prefix = "student")
public class Student {
    private Integer stuId;
    private String stuName;
    private boolean graduate;       // 是否毕业
    private String[] subject;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date birthday;
    private Map<String,String> teacher;
    private Address address;

    public Student() {
    }

    public Student(Integer stuId, String stuName, boolean graduate, String[] subject, Date birthday, Map<String, String> teacher, Address address) {
        this.stuId = stuId;
        this.stuName = stuName;
        this.graduate = graduate;
        this.subject = subject;
        this.birthday = birthday;
        this.teacher = teacher;
        this.address = address;
    }

    public Integer getStuId() {
        return stuId;
    }

    public void setStuId(Integer stuId) {
        this.stuId = stuId;
    }

    public String getStuName() {
        return stuName;
    }

    public void setStuName(String stuName) {
        this.stuName = stuName;
    }

    public boolean isGraduate() {
        return graduate;
    }

    public void setGraduate(boolean graduate) {
        this.graduate = graduate;
    }

    public String[] getSubject() {
        return subject;
    }

    public void setSubject(String[] subject) {
        this.subject = subject;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public Map<String, String> getTeacher() {
        return teacher;
    }

    public void setTeacher(Map<String, String> teacher) {
        this.teacher = teacher;
    }

    public Address getAddress() {
        return address;
    }

    public void setAddress(Address address) {
        this.address = address;
    }

    @Override
    public String toString() {
        return "Student{" +
                "stuId=" + stuId +
                ", stuName='" + stuName + '\'' +
                ", graduate=" + graduate +
                ", subject=" + Arrays.toString(subject) +
                ", birthday=" + birthday +
                ", teacher=" + teacher +
                ", address=" + address +
                '}';
    }
}
